//
//  PhotoBase.h
//

#import <Cocoa/Cocoa.h>


#import "OperationData.h"


@class ExifController;
@class FolderModel;
@class OperationProgressController;


@interface PhotoBase : NSObject
{
@private
	// Used during operations (move/copy/delete/rotate)
	OperationProgressController	*operProgressDialog;
	BOOL			operationInProgress;
	BOOL			operationStop;

	ExifController	*exifDialog;
}

// Derived classes are expected to implement these
- (void) clearSelection;
- (NSString*) currentFolder;
- (FolderModel*) folderModel;
- (NSWindow *) mainWindow;
- (NSSize) maxThumbSize;
- (void) selectCurrent;
- (NSMutableArray*) selectedItems;
- (void) thumbnailUpdated:(ThumbData*) td;
- (void) updateStatusBar;


// Shouldn't need to be overridden...
- (ThumbData *) selectedThumbData;


// Menu actions
- (IBAction) copyImage:(id)sender;
- (IBAction) copyImageToParent:(id)sender;
- (IBAction) generateExifThumbnail:(id)sender;
- (IBAction) getInfo:(id)sender;
- (IBAction) manageSlideshows:(id)sender;
- (IBAction) moveImage:(id)sender;
- (IBAction) moveImageToTrash:(id)sender;
- (IBAction) remoteControl:(id)sender;
- (IBAction) rotateRight:(id)sender;
- (IBAction) rotateLeft:(id)sender;


- (void) selectionChanged:(ThumbData *) td;


- (void) movePanelDidEnd
	:(NSOpenPanel*) openPanel
	returnCode:(int) returnCode  
	contextInfo:(void*) contextInfo;

- (void) moveOrCopySelectedItems
	:(NSString *) moveDir
	copy: (BOOL) copy
	clearSel: (BOOL) clearSel;

- (void) startOperationOnSelectedItems
	:(NSString*) destDir
	sel:(SEL)selOp
	opType:(OperationType)opType
	opString:(NSString*)opString
	clearSel:(BOOL)clearSel
	updateThumb:(BOOL)updateThumb;

- (NSImage*) loadExifThumbnail:(NSString*) filename;


- (void) copy:				(NSWorkspace*)workspace  thumb:(ThumbData*)td  dd:(NSString*)destDir  ret:(int *) pRet;
- (void) generateThumbnail:	(NSWorkspace*)workspace  thumb:(ThumbData*)td  dd:(NSString*)destDir  ret:(int *) pRet;
- (void) move:				(NSWorkspace*)workspace  thumb:(ThumbData*)td  dd:(NSString*)destDir  ret:(int *) pRet;
- (void) rotate90:			(NSWorkspace*)workspace  thumb:(ThumbData*)td  dd:(NSString*)destDir  ret:(int *) pRet;
- (void) rotate270:			(NSWorkspace*)workspace  thumb:(ThumbData*)td  dd:(NSString*)destDir  ret:(int *) pRet;


@end
